<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        #msg{background: red;width: 200px;}
    </style>
</head>
<body>
    <div id="msg">文字</div>
</body>
<script>
    // const s1 = Symbol("a");
    // const s2 = Symbol("a");
    // const s3 = s1;

    // console.log(s1);
    // console.log(s2);

    // console.log(s1 === s2);
    // console.log(s1 === s3);

    // console.log(typeof s1);

    // 下拉菜单的显示和隐藏

    const omsg = document.getElementById("msg");

    // 状态库（字典量）
    let DATA = {
        hide:Symbol(),
        show:Symbol()
    }

    // 默认状态
    let flag = DATA.hide;
    
    document.onclick = function(){
        if(flag === DATA.hide){
            omsg.style.display = "none";
            flag = DATA.show;
        }else{
            omsg.style.display = "block";
            flag = DATA.hide;
        }
    }


</script>
</html>